<template>
    <div class="my-banner">
        <van-swipe class="my-swipe" :autoplay="2000" :duration="1000" indicator-color="red">
            <van-swipe-item v-for="item in bannerList" :key="item.bannerid">
                <van-image :src="item.img"></van-image>
            </van-swipe-item>

        </van-swipe>
    </div>

</template>
<script setup lang="ts">
import { getBannerList } from '@/api/home';
import type { MyBannerItem } from '@/config/interface'
import { ref, onMounted } from 'vue'
const bannerList = ref<MyBannerItem[]>([])

onMounted(async () => {
    const res = await getBannerList()
    bannerList.value = res.data
    console.log(bannerList);
    console.log(res.data);
    console.log(res);
    
    
})





</script>


<style scoped lang="scss">
@import '@/styles/variable.scss';

.my-banner {
    width: 380px;
    height: 170px;
    position: relative;
    box-sizing: border-box;
    padding: 15px;

    &::after {
        content: '';
        position: absolute;
        left: 0;
        top: -50px;
        width: 100%;
        height: 100%;
        background-color: $globalColor !important;
        border-radius: 0 0 200px 200px / 0 0 40px 40px;
        z-index: -1;
    }

    >.my-swipe {
        width: 100%;
        height: 100%;
        background-color: orange;
        border-radius: 10px;
        overflow: hidden;
    }
}
</style>
